
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="/ttms/index.jsp">主页</a>
</div>

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav" id="menu">
        <li><a href="manage/releaseServlet?action=page">上映管理 <span class="sr-only">(current)</span></a></li>
        <li><a href="manage/studioServlet?action=page&pageNo=1">影厅管理</a></li>
        <li><a href="manage/playServlet?action=page">影片管理</a></li>
        <li><a href="manage/ticketServlet?action=page">售票管理</a></li>
        <li><a href="manage/usermanageServlet?action=page">用户管理</a></li>
    </ul>
    <ul class="nav navbar-nav navbar-right">
        <li><a href="#">反馈问题</a></li>
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">个人管理 <span class="caret"></span></a>
            <ul class="dropdown-menu" aria-labelledby="dLabel">
                <li><a href="manage/usermanageServlet?action=admin">进入空间</a></li>
                <li><a href="userServlet?action=logout">退出登录</a></li>
            </ul>
        </li>
    </ul>
</div>
<script>
    var menu = document.getElementById('menu');
    var lis = menu.querySelectorAll('li');
    // var items = document.querySelectorAll('.item');

    for(var i = 0;i<lis.length;i++){
        // lis[i].setAttribute('index',i);
        lis[i].onclick = function (){
            for(var i =0;i<lis.length;i++){
                lis[i].className = '';
            }
            this.className = 'active';
            // var index = this.getAttribute('index');
        //     for(var i = 0;i<items.length;i++){
        //         items[i].style.display = 'none';
        //     }
        //     items[index].style.display = 'block';
        }
    }
</script>